home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / pascal / xlibpas2.zip / XLIB2.DOC < prev    next >
Text File  |  1994-06-12  |  41KB  |  930 lines

  1. ╔═══════════════════════════════════════════════════════════════════════════╗
  2. ║                                                                           ║
  3. ║        XLIB v2.0 - Graphics Library for Borland/Turbo Pascal 7.0          ║
  4. ║                                                                           ║
  5. ║               Tristan Tarrant - tristant@cogs.susx.ac.uk                  ║
  6. ║                                                                           ║
  7. ╠═══════════════════════════════════════════════════════════════════════════╣
  8. ║                                                                           ║
  9. ║                                 Credits                                   ║
  10. ║                                                                           ║
  11. ║                             Themie Gouthas                                ║
  12. ║                                                                           ║
  13. ║                            Matthew MacKenzie                              ║
  14. ║                                                                           ║
  15. ║                             Tore Bastiansen                               ║
  16. ║                                                                           ║
  17. ║                                 Andy Tam                                  ║
  18. ║                                                                           ║
  19. ║                               Douglas Webb                                ║
  20. ║                                                                           ║
  21. ║                              John  Schlagel                               ║
  22. ║                                                                           ║
  23. ╠═══════════════════════════════════════════════════════════════════════════╣
  24. ║                                                                           ║
  25. ║           I informally reserve all rights to the code in XLIB             ║
  26. ║       Rights to contributed code is also assumed to be reserved by        ║
  27. ║                          the original authors.                            ║
  28. ║                                                                           ║
  29. ╚═══════════════════════════════════════════════════════════════════════════╝
  30.  
  31. ╔═══════════════════════════════════════════════════════════════════════════╗
  32. ║ DISCLAIMER                                                                ║
  33. ╚═══════════════════════════════════════════════════════════════════════════╝
  34.  
  35.   This library is distributed AS IS. The author/s specifically disclaim any
  36.   responsibility for any loss of profit or any incidental, consequential or
  37.   other damages.
  38.  
  39. ╔═══════════════════════════════════════════════════════════════════════════╗
  40. ║ INTRODUCTION                                                              ║
  41. ╚═══════════════════════════════════════════════════════════════════════════╝
  42.  
  43.   XLIB is a "user supported freeware" graphics library specifically designed
  44.   with game programming in mind.
  45.  
  46.   It has been placed in the public domain for the benefit of all, and
  47.   represents *MANY* hours of work so it is requested that all users comply
  48.   with the the wishes of the author/s as specified in the individual modules
  49.   and:
  50.     a) To leave the code in the public domain
  51.     b) Not distribute any modified or incomplete versions of this library
  52.  
  53.   New contribution and comments are welcome and hopefully there will be more
  54.   releases as the code evolves.
  55.  
  56.   Finally, do not trust this excuse for a manual if in doubt, as this code has
  57.   undergone several revisions. The place to get the answers is in the code
  58.   itself.
  59.  
  60. ╔═══════════════════════════════════════════════════════════════════════════╗
  61. ║ REQUIREMENTS                                                              ║
  62. ╚═══════════════════════════════════════════════════════════════════════════╝
  63.  
  64.   Minimum requirements
  65.     386 processor,
  66.     VGA,
  67.     Borland/Turbo Pascal v7.0
  68.  
  69. ╔═══════════════════════════════════════════════════════════════════════════╗
  70. ║ GENERAL FEATURES                                                          ║
  71. ╚═══════════════════════════════════════════════════════════════════════════╝
  72.  
  73.   Support for a number of 256 colour tweaked graphics mode resolutions :
  74.  
  75.     320x200 320x240 360x200 360x240 376x282 320x400 320x480 360x400 360x480
  76.     360x360 376x308 376x564 256x200 256x240 256x224 256x256 360x270 400x300
  77.  
  78.   Please note that some of these resolutions best suit monitors with
  79.   adjustable vertical height.
  80.  
  81.   Virtual screens larger than the physical screen (memory permitting) that
  82.   can be panned at pixel resolution in all directions
  83.  
  84.   A split screen capability
  85.  
  86.   Text functions supporting 8x8 and 8x14 ROM fonts and user defined fonts
  87.  
  88.   Support for page flipping
  89.  
  90.   Graphics primitives such as line and rectangle drawing functions and
  91.   of course bit block manipulation functions
  92.  
  93.   Virtual VSync Handler
  94.     
  95.   Compression and archiving
  96.  
  97.   GIF/BMP loading and saving
  98.  
  99. ╔═══════════════════════════════════════════════════════════════════════════╗
  100. ║ BUILDING THE LIBRARIES                                                    ║
  101. ╚═══════════════════════════════════════════════════════════════════════════╝
  102.  
  103.   To compile XLIB use the provided makefile. Just put all of the XLIB files
  104.   in the same directory and type MAKE at the DOS prompt. This will build all
  105.   the libraries and examples. If Borland Pascal isn't in your path just edit
  106.   the makefile where indicated. BP 7.0 and TASM are required to compile the
  107.   libraries.
  108.   If you want to make units with full debug information, compile with
  109.     MAKE -DDEBUG
  110.   To make the DPMI versions of the units, compile with
  111.     MAKE -DDPMI
  112.  
  113. ╔═══════════════════════════════════════════════════════════════════════════╗
  114. ║ USING THE LIBARY WITH YOUR PROGRAMS                                       ║
  115. ╚═══════════════════════════════════════════════════════════════════════════╝
  116.  
  117.   Using the XLIB library in your programs is simple. Just include the XLIB
  118.   units in the uses statement at the beginning of your program which will make
  119.   all the procedures and functions composing the XLIB library available.
  120.  
  121. ╔═══════════════════════════════════════════════════════════════════════════╗
  122. ║ GLOBAL CONSTANTS, VARIABLES AND TYPES                                     ║
  123. ╚═══════════════════════════════════════════════════════════════════════════╝
  124.  
  125. Type
  126.     Vertex = record
  127.         x, y : word;
  128.     end;              - Vertex record used for xpolygon.
  129.  
  130.     VBMInfoStruc = record
  131.         Size, ImageWidth, ImageHeight : word;
  132.     end;              - Video Bitmap Structure
  133.  
  134.     VBMAlignmentStruc = record
  135.         ImagePtr, MaskPtr : word;
  136.     end;              - Video Bitmap Structure to data in VRAM
  137.  
  138.     AlignmentHeader = record
  139.         size, ImageWidth, ImageHeight : word;
  140.         alignments : array[0..3] of
  141.         record
  142.              ImagePtr, MaskPtr : word;
  143.         end;
  144.     end;              - Video Bitmap VRAM stuff
  145.  
  146.     LBMHeader = record
  147.         width, height : byte;
  148.     end;              - Linear/Planar Bitmap header
  149.  
  150.     PAlignmentHeader = ^AlignmentHeader;
  151.                                         - Pointer to VBM VRAM info
  152.  
  153. Const
  154.   XMode320x200  = 0;       320x200x256 colors - 4.0+ pages
  155.   XMode320x240  = 1;       320x240x256 colors - 3.4+ pages - Square Pixels
  156.   XMode360x200  = 2;       360x200x256 colors - 3.6+ pages
  157.   XMode360x240  = 3;       360x240x256 colors - 3.0+ pages
  158.   XMode376x282  = 4;       376x282x256 colors - 2.4+ pages - Square Pixels
  159.   XMode320x400  = 5;       320x400x256 colors - 2.0+ pages
  160.   XMode320x480  = 6;       320x480x256 colors - 1.7+ pages
  161.   XMode360x400  = 7;       360x400x256 colors - 1.8+ pages
  162.   XMode360x480  = 8;       360x480x256 colors - 1.5+ pages
  163.   XMode360x360  = 9;       360x360x256 colors - 2.0+ pages
  164.   XMode376x308  = 10;      376x308x256 colors - 2.2+ pages
  165.   XMode376x564  = 11;      376x564x256 colors - 1.2+ pages
  166.   XMode256x200  = 12;      256x200x256 colors - 5.1+ pages
  167.   XMode256x240  = 13;      256x240x256 colors - 4.2+ pages
  168.   XMode256x224  = 14;      256x224x256 colors - 4.5+ pages
  169.   XMode256x256  = 15;      256x256x256 colors - 4.0